<%@ page import="love.yuanmengrobot.als.system.javaBean.AlsUser" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%--
  Created by IntelliJ IDEA.
  User: CHJYPC
  Date: 2021/6/1
  Time: 19:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>账号管理</title>
    <link rel="stylesheet" type="text/css" href="${rootPath}resources/css/accountManagement.css"/>
    <script type="text/javascript" src="${rootPath}resources/js/accountManagement/accountManagement.js"></script>
</head>
<body onload="tipToView('${add}','${delete}','${update}')">
<div>
    <div class="header"><h2 class="headerT">账号管理</h2></div>
    <div class="container-fluid">
        <div class="container-fluid-header">
                <span class="search bar1">
                    <form id="searchInputForm" action="accountManagement?op=3" method="post" style="display:inline">
                        <input type="text" id="searchBox" name="searchContent" value="${historySearch}" placeholder="请输入用户名搜索...">
                    </form>
                    <button onclick="search()">搜索</button>
                    <button onclick="reload()">取消</button>
                    <button onclick="addUserForm()">添加账号</button>
                </span>
        </div>
        <div class="container-fluid-body">
            <table class="mainTable">
                <thead>
                <tr></tr>
                <tr>
                    <th>ID</th>
                    <th>用户名</th>
                    <th>密码</th>
                    <th>电话号码</th>
                    <th>邮箱</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <c:set var="sum" value="1"/>
                <c:forEach var="user" items="${allUser}">

                    <tr>
                        <td>
                                ${user.userid}
                        </td>

                        <td>
                            <div class=""> ${user.username} </div>
                        </td>
                        <td>
                            <div class=""> *****
                                </div>
                        </td>
                        <td>
                            <div class=""> ${user.userphone}</div>
                        </td>
                        <td>
                            <div class="">${user.useremail}</div>
                        </td>
                        <td>
                            <div class="">
                                <button onclick="updatePasswordForm(${user.userid})">重置密码</button>
                                <button onclick="deleteUser(${user.userid})">删除</button>
                            </div>
                        </td>
                    </tr>

                    <c:set var="sum" value="${sum+1}"/>
                </c:forEach>
                <tr></tr>
                </tbody>
            </table>
        </div>
    </div>
</div>

<div style="display:none">
    <form id="deleteForm" action="accountManagement?op=2" method="post">
        <input type="text" name="deletetId" id="deleteFormInput" value="" hidden="">
    </form>
</div>

<div id="light" class="white_content" >
    <div class="formHead">
        <span id="formTitle" class="formTitle"></span>
        <button type="button" aria-label="Close" class="ant-modal-close" onclick = "closeForm()">X</button>
    </div>
    <div class="formBody">
        <div class="sortMessage" id="sortMessage" style="display: none">
            <form id="addUser" action="accountManagement?op=0" method="post">
                <div class="mainMessage" id="mainMessage">
                <input type="text"  name="newusername" onblur="checknull(this,'用户名不能为空')" value="" placeholder="请输入用户名" >
                <input type="text"  name="newpassword" onblur="checknull(this,'密码不能为空')" value="" placeholder="请输入密码" >
                <input type="text" id="newphone" name="newphone" onkeyup="phoneCheck()" onblur="checknull(this,'号码不能为空')" value="" placeholder="请输入电话号码" >
                </div>
                <input type="text" id="newemail" name="newemail" onkeyup="emailCheck()" value="" placeholder="请输入邮箱(非必填)" >
                <button  class="newMessage-button" onclick="addUserSubmit()">添加</button>
            </form>
        </div>

        <div class="sortPassword" id="sortPassword" style="display: none">
            <form action="accountManagement?op=1" id="sortPasswordForm" method="post">
                <input name="update_Id" id="updateId" value="1" hidden="true">
                <div class="mainMessage">
                <input type="password" name="newPassword" onblur="checknull(this,'密码不能为空')" value="" placeholder="请输入新的密码">
                </div>
                <button onclick="updatePasswordSubmit()" >确定</button>
            </form>
        </div>
        <div class="warrningText"><p id="warrningContent"></p></div>
    </div>
</div>
<div id="fade" class="black_overlay"></div>


<script>

</script>


</body>
</html>

